package com.my.study.designPatterns.decoratePattern;

/**
 * 具体装饰者类Whip
 */
public class Whip extends CondimentDecorator {

    //被装饰的类
    private Beverage beverage;

    public Whip(Beverage beverage) {
        this.beverage = beverage;

    }

    @Override
    public double cost() {
        return beverage.cost() + 0.18;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Whip";
    }
}
